import numpy as np
from numpy import ndim

a = np.array([1, 2])
b = np.array([3, 4])
print(a - b)

b = np.array([(1, 2, 3), (4, 5, 6)])
print(b)

print(b.ndim, b.shape, b.size)
print(b.dtype, b.itemsize)

a = np.array([1, 2, 3])
print(a)
b = np.array(([1, 2, 3], [4, 5, 6]))
print(b)

print(np.ones([2, 3]))
print(np.zeros([2, 5]))

print(np.arange(1, 5, 0.5))
print(np.linspace(1, 2, 10, endpoint=False))
print(np.logspace(1, 8, 2, endpoint=True))

a = np.array([1, 2, 3, 4, 5, 6, 7, 8, 9])
print(a[0:5:2])
print(a[[1, 5]])

b = np.array(([1, 2, 3], [4, 5, 6], [7, 8, 9]))
print(b[:, [1, 2]])

print(a // 2)
print(a ** 3)
print(a + 5)
print(a - 5)
print(a / 5)
print(b * b)
print(b * b / np.array(([1, 1, 2], [2, 4, 8], [1, 1, 5])))
